<template>
	<view class="content">
		<view class="text">
			<view class="des">请详细描述反馈内容</view>
			<view class="num">{{ desc.length }}/200</view>
		</view>
		<view class="textarea_box">
			<textarea class="textarea" placeholder="请详细描述反馈内容" maxlength="200"  v-model="desc" />
		</view>
		<view class='tip'>您的反馈是我们前进的动力^_^</view>
		<view class='post-btn' @click="postFun">提交反馈</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				desc: '',
			}
		},
		methods: {
			postFun(){
				let vm = this;
				if(vm.desc == ''){
					return uni.showToast({
						title:'请输入具体反馈',
						icon:"none"
					});
				};
				vm.$H.post('user/feedback',{
					content:vm.desc
				}).then(res=>{
					uni.showToast({
						title:res.data.msg,
						icon:"none"
					});
					setTimeout(()=>{
						uni.navigateBack();
					},2000);
				}).catch(err=>{
					uni.showToast({
						title:err,
						icon:"none"
					});
				})
			}
		}
	}
</script>

<style lang="scss">
	.content {
		width: 95%;
		margin: 0 auto;
		.text {
			display: flex;
			justify-content: space-between;
			align-items: center;
			.des {
				color: #000000;
				font-size: 35rpx;
				font-weight: 700;
				margin: 30rpx 0;
			}
		}
		.textarea_box {
			width: 100%;
			.textarea {
				width: 100%;
				background-color: #F2F5F9;
				margin: 0 auto;
				border-radius: 10rpx;
				margin-top: 10rpx;
				padding: 20rpx;
			}
		}
		.tip{
			font-size:24rpx;
			color: #ccc;
			margin-top: 15rpx;
		}
		.post-btn{
			left: 0;
			right: 0;
			position: fixed;
			text-align: center;
			background: darkseagreen;
			padding: 40rpx 0;
			bottom: 0;
			color: #FFF;
			font-size: 16px;
		}
	}
</style>
